package io.yizoo.core;

import io.elm.core.saas.DSContext;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 获取某个企业的配置信息
 */
public class ConfigUtil {

    public static Map<String, Object> getConfig(String key) {
        List<Map<String, Object>> dataSet = DSContext.DATA_SET;
        if (dataSet == null) {
            return null;
        }
        Map<String,Object> result = new HashMap<>();
        for (Map<String, Object> map : dataSet) {
            if (map.get("key").equals(key)) {
                result.putAll(map);
                return result;
            }

        }

        return null;
    }
}
